<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!--  参考 http://www.jeasyui.net/demo/504.html -->
<title>开户列表</title>
<!-- 载入easyui样式及图标样式  注意该一下路径-->
<link rel="stylesheet" type="text/css"
	href="/Goktech-Bank-System/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css"
	href="/Goktech-Bank-System/easyui/themes/icon.css">
<!-- 载入jquery支持文件（必须写在其他js文件前）、easyui支持文件、easyui中文支持文件 -->
<script type="text/javascript"
	src="/Goktech-Bank-System/easyui/jquery.min.js"></script>
<script type="text/javascript"
	src="/Goktech-Bank-System/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript"
	src="/Goktech-Bank-System/easyui/locale/easyui-lang-zh_CN.js"></script>
<link rel="stylesheet" href="/Goktech-Bank-System/common/css/layui.css">
<link rel="stylesheet" href="/Goktech-Bank-System/css/alertDiv.css">
</head>
<style>
class tr td /*设置表格文字左右和上下居中对齐*/ {
	vertical-align: middle;
	text-align: center;
}

.article_push_time {
	font-size: 14px;
	/*padding-left: 5px;*/
}

.main_title {
	font-size: 14px;
	padding: 15px 20px;
	background-color: #EEEEEE;
	border-radius: 6px 6px 0 0;
	position: relative;
	margin-left: 20px;
	margin-right: 34px;
	margin-bottom: 20px;
}

.plan_item {
	font-size: 14px;
	padding: 15px 20px;
	background-color: gray;
	border-radius: 6px 6px 0 0;
	position: relative;
	width: 661px;
	float: left;
	border: 1px;
	margin-right: 34px;
	box-shadow: 0 1px 2px 0 rgba(0, 0, 0, .1);
}

.sc_plan_title {
	font-size: 24px;
	color: #555;
	font-weight: 700;
	line-height: 76px;
	margin-top: 5px;
	padding: 5px 24px;
	background-color: #f5f4f3;
	margin-bottom: 32px;
}

.main_title_bread {
	margin: 0 10px;
	font-size: 18px;
}

.sc_stage_current_item {
	background: #e36b3a;
}

.border-radius-6 {
	border-radius: 6px;
}

.menu_wrap li {
	display: block;
	text-align: right;
	color: #555;
	padding: 12px 10px 12px 0;
}

.pro_day {
	display: block;
	font-size: 24px;
	font-weight: 700;
}

.pro_message {
	display: block;
	font-size: 14px;
}

.current_li {
	border: 2px solid #f8996d;
	border-radius: 6px;
	color: #f8996d;
}

.btn_wrap {
	margin-top: 20px;
	padding-bottom: 30px;
}

/* .content-main {
	
	padding: 20px 20px;
} */
.divmargin {
	margin: 5px 0px 10px 30px;
}
</style>

<body>
	<div style="padding-top: 10px;">
		<button id="addbtn" class="layui-btn" style="border-radius: 4px"
			onclick="one()">
			<i class="icon-font">&#xe654;</i>添加开户
		</button>
	</div>
	<div style="margin: 20px 0;"></div>

	<table id="dg" title="开户信息管理" style="width: 99%"
		data-options="singleSelect:true,pagination:true,url:'/Goktech-Bank-System/kaihu/easyuiGetData',method:'get',toolbar:'#tb'">
		<thead>
			<tr>
				<!--  field 和你javaean属性一样 -->
				<th style="width:17%"data-options="field:'liush',width:120">流水号</th>
				<th style="width:17%"data-options="field:'cunkrmc',width:120">存款人名称</th>
				<th style="width:17%"data-options="field:'cunkrdh',width:120">存款人电话</th>
				<th style="width:17%"data-options="field:'zhucdz',width:350">注册地址</th>
				<th style="width:16%"data-options="field:'youzbm',width:120">邮政编码</th>
				<th style="width:16%"data-options="field:'faddbr',width:120">法定代表人</th>
			</tr>
		</thead>
	</table>


	<!-- 搜索框 -->
	<div id="tb">
		存款人名称：<input type="text" name="cunkrmc" id="cunkrmc" />  <a
			id="standardQueryBtn" href="javascript:void(0)"
			class="easyui-linkbutton" data-options="iconCls:'icon-search'">搜索</a>
	</div>
	<!-- 弹出层 sta -->
	<div id="light" class="white_content">
		<div
			style="background-color: #f2f2f2; height: 30px; padding-top: 10px; padding-left: 16px">开户界面1</div>
		<a class="float_div" href="javascript:hide();">X关闭</a>
		<form style="padding: 16px;">
			企业名称/统一信用代码:<input type="text" name="companyCode" /><br> <br>
			账户性质 :<input type="text" /> 存款人电话:<input type="text" /> <br> <br>
		</form>
		<button id="nextbtn1" class="layui-btn "
			style="line-height: 15px; height: 28px; margin-left: 20px">下一步</button>
	</div>
	<!-- 弹出层2 sta -->
	<div id="light2" class="white_content">
		<div
			style="background-color: #f2f2f2; height: 30px; padding-top: 10px; padding-left: 16px">校验结果</div>
		<a class="float_div" href="javascript:hide();">X关闭</a>
		<div>
			<table style="vertical-align: middle; text-align: center;"
				align="center" width="500" border=1 bordercolor="#000">
				<tr>
					<td>来源</td>
					<td>结果</td>
					<td>说明</td>
				</tr>
				<tr>

					<td>严重违法失信名单</td>
					<td>通过</td>
					<td>未在严重违法失信名单</td>
				</tr>
				<tr>
					<td>银行黑名单</td>
					<td>通过</td>
					<td>未在银行黑名单</td>
				</tr>
			</table>

		</div>
		<button id="nextbtn2" class="layui-btn "
			style="line-height: 15px; height: 28px; margin: 10px 20px">下一步</button>
	</div>

	<!-- 弹出层三 -->
	<div id="light3" class="white_content">
		<div
			style="background-color: #f2f2f2; height: 30px; padding-top: 10px; padding-left: 16px">校验结果</div>
		<a class="float_div" href="javascript:hide();">X关闭</a>
		<div class="content-main">
			<BR>
			<div class="divmargin">
				存款人名称:<INPUT id="cunkrmc" class="textInput"
					style="height: 28px; width: 400PX" maxLength="150" size=30
					type=text name="cunkrmc"> <BR>
			</div>
			<div class="divmargin">
				存款人电话: <INPUT id="cunkrdh" class="textInput"
					style="height: 28px; width: 400PX" maxLength="150" size=30
					type=text name="cunkrdh"> <BR>
			</div>
			<div class="divmargin">
				注&nbsp;册&nbsp;地&nbsp;址: <INPUT id="zhucdz" class="textInput"
					style="height: 28px; width: 400PX" maxLength="150" size=30
					type=text name="zhucdz"> <BR>
			</div>
			<div class="divmargin">
				邮&nbsp;政&nbsp;编&nbsp;码 :<INPUT id="youzbm" class="textInput"
					style="height: 28px; width: 400PX" maxLength="150" size=30
					type=text name="youzbm"> <BR>
			</div>
			<div class="divmargin">
				法定代表人: <INPUT id="faddbr" class="textInput"
					style="height: 28px; width: 400PX" maxLength="150" size=30
					type=text name="faddbr"> <BR>
			</div>
			<div class="divmargin">
				办&nbsp;理&nbsp;机&nbsp;构： <select style="margin-top: 10px;" name="jigid" id="note_type">
					
				</select>
			</div>
		</div>
		<button id="btn" class="layui-btn "
			style="line-height: 15px; height: 28px; margin: 10px 50px">保存</button>
	</div>



	<div id="fade" class="black_overlay"></div>
	<!-- 弹出层 end -->
	<script type="text/javascript">
		$(function() {
			var pager = $('#dg').datagrid().datagrid('getPager'); // get the pager of datagrid
			pager.pagination();
		})
		function one() {
			document.getElementById('light').style.display = 'block';
			document.getElementById('fade').style.display = 'block'
		}

		function hide() {
			document.getElementById('light').style.display = 'none';
			document.getElementById('fade').style.display = 'none'
			document.getElementById('light2').style.display = 'none';
			document.getElementById('light3').style.display = 'none';
		}
		$("#nextbtn1").click(function() {
			document.getElementById('light').style.display = 'none';
			var companyCode = $("input[name=companyCode]").val();
			$.get("/Goktech-Bank-System/kaihu/checkData", {
				"companyCode" : companyCode
			}, function(data) {
				if (data.code == 1) {
					document.getElementById('light2').style.display = 'block';
				} else {
					document.getElementById('fade').style.display = 'none'
					alert("数据校验不通过");
				}
			});

		});
		$("#nextbtn2").click(
				function() {

					$.get("/Goktech-Bank-System/Jig/getJg", null,
							function(data) {
								var h = '<option value="0000"></option>';
								$.each(data, function() {
									h += '<option value="'+this.id+'">'
											+ this.jigmc + '</option>'
								});
								$("#note_type").html(h);
							});

					document.getElementById('light2').style.display = 'one';
					document.getElementById('light3').style.display = 'block';
				});

		$("#btn").click(function() {
			var param = {};
			param.cunkrmc = $("#cunkrmc").val();
			param.cunkrdh = $("#cunkrdh").val();
			param.zhucdz = $("#zhucdz").val();
			param.youzbm = $("#youzbm").val();
			param.faddbr = $("#faddbr").val();
			param.jigid = $("#note_type").val();
			
			$.ajax({
				type : "post",
				url : "/Goktech-Bank-System/kaihu/save",
				contentType : "application/json;charset=UTF-8",
				dataType : "JSON",
				data : JSON.stringify(param),
				success : function a(data) {
					if (data.code == -11) {
						alert("信息保存失败");
					}
					window.location.reload();
				},
				error : function err() {
					alert("服务器发生错误");
				}
			});
		});

		function add() {
			console.log($('#dg').datagrid('getSelected').id)
		}

		function getSelected() {
			var row = $('#dg').datagrid('getSelected');
			if (row) {
				$.messager.alert('Info', row.itemid + ":" + row.productid + ":"
						+ row.attr1);
			}
		}
		$("#standardQueryBtn").click(function() {
			//$("#dg") 获取easui的数据表格   datagrid("load" 重新加载表格 后面的几个数据是请求的参数
			$("#dg").datagrid("load", {
				"cunkrmc" : $("#cunkrmc").val()
			});
		});
	</script>
</body>
</html>